<%@ page language="java"  pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<style>
.pageFormContent .unit label{width: 70px;}
.pageFormContent .unit .sp{padding: 2px; line-height: 20px; color:#aaa;}
span.error{left: 240px; width: 110px;}
</style>
<script type="text/javascript">
	$(document).ready(function(){
		$("#selProductId").change(function(){
			var $this = $(this);
			if($this.val()== ""){
				$("#selBrandId option").not(":first").remove();
			}else{
				var txt = $("#sp_proBrandJson").text(), proId = $this.val();
				if($.trim(txt) != ""){
					$("#selBrandId option").not(":first").remove();
					var selJson = $.parseJSON(txt);
					$.each(selJson, function(i){
						var key2 = 'pro_'+proId;
						if(i == key2){ 
							$.each(selJson[i], function(j){
								$("#selBrandId").append('<option value="'+selJson[i][j].id+'">'+selJson[i][j].brandName+'</option>');
							});
						}
					});
				}
			}
		});
	});
</script>
<div class="pageContent">
	<form method="post" action="saveCategory?callbackType=closeCurrent" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)">
		<div class="pageFormContent" layoutH="58">
			<div class="unit">
				<label>品 名: </label>
				<select name="sysProductId" id="selProductId"  class="required" style="width:165px;">
					<option value="">-选择品名-</option>
					<c:forEach var="pro" items="${productList }">
						<option value="${pro.id }">${pro.productName }</option>
					</c:forEach>
				</select>
				<span class="sp"><font style="color:#f00;">*</font> 如果没有品名, 需新增</span>
			</div>
			<div class="unit"></div>
			<div class="unit">
				<label>品 牌：</label>
				<select name="brandId" id="selBrandId" class="required" style="width:165px;">
					<option value="" selected="selected">-选择品牌-</option>
				</select>
				<span class="sp"><font style="color:#f00;">*</font> 如果没有品牌, 需新增</span>
			</div>
			<div class="unit"></div>
			<div class="unit">
				<label>型号名称：</label>
				<input type="text" name="modelName" class="required" size="25" maxlength="16" />
				<span class="sp">如: 5S, 荣耀3, C8650</span>
			</div>
			<div class="unit"></div>
			<div class="unit">
				<label>配 置: </label>
				<textarea rows="3" cols="22" maxlength="128" name="modelDesc"></textarea>
				<span class="sp">如: 标配, 一电一充等</span>
			</div>
		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent">
					<span style="display:none;" id="sp_proBrandJson">${brandOfProductJson }</span>
					<button type="submit">提交</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div>
	</form>
</div>
